# 后端构建阶段
FROM python:3.10.16

# 安装 LibreOffice 及字体支持
RUN apt-get update && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /app

# 先复制依赖文件
COPY requirements.txt /app/
# 安装依赖
RUN pip install --upgrade pip && \
    pip install --no-cache-dir -r /app/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

# 复制后端代码
COPY . /app

# 暴露后端端口
EXPOSE 8000

# 启动命令
CMD ["python", "/app/main.py"]